#ifndef BLOCK_H
#define BLOCK_H
#include "D3DApp.h"
#include "GameObject.h"
#include "dxut/DXUT.h"

struct Triangle
{
	Triangle(){}
	Triangle(D3DXVECTOR3 x,D3DXVECTOR3 y,D3DXVECTOR3 z)
	{
		a=x;b=y;c=z;
		ab=b-a;
		bc=c-b;
		ca=a-c;
	}
	D3DXVECTOR3 a;
	D3DXVECTOR3 b;
	D3DXVECTOR3 c;
	D3DXVECTOR3 ab;
	D3DXVECTOR3 bc;
	D3DXVECTOR3 ca;
};

class Block : public GameObject
{
public:
	bool Create(std::vector<D3DXVECTOR3> v,D3DXVECTOR3 centre);

private:
	std::vector<D3DXVECTOR3> m_vCorners;
	LPDIRECT3DINDEXBUFFER9 m_Ib;
	LPDIRECT3DVERTEXBUFFER9 m_Vb;
	std::vector<Triangle> m_vRawTris;
	std::vector<Triangle> m_vPossibles;
	std::vector<Triangle> m_vBuildAreas;
};
#endif